<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title></title>
		<meta name="renderer" content="webkit">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
		<link rel="stylesheet" href="../../../../layuiadmin/layui/css/layui.css" media="all">
		<link rel="stylesheet" href="../../../../layuiadmin/style/admin.css" media="all">
		<link rel="stylesheet" href="../../../../css/common.css" media="all">

	</head>

	<body>

		<body>
			<div class="layui-fluid">
				<div class="layui-row layui-col-space15">
					<div class="layui-col-md12">
						<div class="layui-card">
							<div class="layui-card-body">
								<table class="layui-hide" id="test-table-operate" lay-filter="test-table-operate"></table>
								<script type="text/html" id="zizeng">
									{{d.LAY_TABLE_INDEX+1}}
								</script>

								<div class="layui-form-item layui-layout-admin">
									<div class="layui-input-block">
										<div class="layui-footer" style="left: 0;">
											<button class="layui-btn" id="queding">确定</button>
										</div>
									</div>
								</div>

							</div>
						</div>
					</div>
				</div>
			</div>
			<script src="../../../../layuiadmin/layui/layui.js"></script>
			<script src="../../../../js/jquery.min.js"></script>
			<script src="../../../../js/jquery.jqprint-0.3.js"></script>
			<script src="../../../../js/common.js"></script>
			<script>
				var _data = {
					skuid: getParam('skuid')
				}
				layui.config({
					base: '../../../../layuiadmin/' //静态资源所在路径
				}).extend({
					index: 'lib/index' //主入口模块
				}).use(['index', 'table', 'form'], function() {
					var table = layui.table,
						$ = layui.$,
						form = layui.form,
						laydate = layui.laydate,
						admin = layui.admin;

					if(_data.skuid) {
						initdata();
					}
					function initdata() {
						table.render({
							elem: '#test-table-operate',
							url: server.querygoods,
							height: 'full-115',
							cols: [
								[{
									field: 'zizeng',
									width: 50,
									title: '#',
									fixed: 'left',
									templet: '#zizeng'
								}, {
									field: 'skuname',
									width: 160,
									title: '商品名称'
								}, {
									field: 'skuid',
									width: 120,
									title: '商品编号'
								},  {
									field: 'spuid',
									width: 120,
									title: '产品编号'
								}, {
									field: 'specname',
									width: 160,
									title: '规格名称'
								},{
									field: 'addtime',
									width: 180,
									title: '创建时间',
								}, {
									field: 'edittime',
									width: 180,
									title: '更新时间',
								}]
							],
							page: true,
							where: _data,
							limit: limit,
							limits: limits,
							request: {
								pageName: 'page',
								limitName: 'size',
							},
							parseData: function(res) { //将原始数据解析成 table 组件所规定的数据
								return {
									"code": res.code, //解析接口状态
									"msg": res.msg, //解析提示文本
									"count": res.goods_list.pager.total, //解析数据长度
									"data": res.goods_list.data //解析数据列表
								};
							}
						});
					}
				});
				$('#queding').on('click', function() { //获取选中数据
					var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
					parent.layer.close(index); //再执行关闭
				});
			</script>
		</body>

</html>